package com.njbw.design_pattern.created.factory.abstractFactory.resourceFactory.impl;

import com.njbw.design_pattern.created.factory.abstractFactory.product.AbstractPictureResource;
import com.njbw.design_pattern.created.factory.abstractFactory.product.AbstractTextResource;
import com.njbw.design_pattern.created.factory.abstractFactory.product.AbstractVideoResource;
import com.njbw.design_pattern.created.factory.abstractFactory.product.impl.defaults.DefaultPictureResource;
import com.njbw.design_pattern.created.factory.abstractFactory.product.impl.defaults.DefaultTextResource;
import com.njbw.design_pattern.created.factory.abstractFactory.product.impl.defaults.DefaultVideoResource;
import com.njbw.design_pattern.created.factory.abstractFactory.resourceFactory.AbstractResourceLoader;

/**
 * 默认资源加载器
 *
 * @author 黄侯淳
 * @since JDK 1.8
 */
public class DefaultResourceLoader extends AbstractResourceLoader {

    @Override
    public AbstractPictureResource loadPictureResource(String url) {
        return new DefaultPictureResource(url);
    }

    @Override
    public AbstractVideoResource loadVideoResource(String url) {
        return new DefaultVideoResource(url);
    }

    @Override
    public AbstractTextResource loadTextResource(String url) {
        return new DefaultTextResource(url);
    }
}
